<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta content="telephone=no" name="format-detection">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1;user-scalable=no;">
    <title>1起购</title>
    <link rel="stylesheet" href="/statics/view/css/bootstrap.css">
    <link rel="stylesheet" href="/statics/view/css/style.css">
    <link rel="stylesheet" href="/statics/view/css/order3.css">
    <link rel="stylesheet" href="/statics/view/css/invoice.css">
    <link rel="stylesheet" href="/statics/weui/weui.min.css">
    <link href="/statics/view/css/yy_pay.css" rel="stylesheet">
    <script charset="utf-8" src="/statics/view/js/jquery.min.js"></script>
    <script charset="utf-8" src="/statics/view/js/global.js"></script>
    <script charset="utf-8" src="/statics/view/js/bootstrap.min.js"></script>
    <script charset="utf-8" src="/statics/view/js/template.js"></script>
</head>
<body>
<div class="fanhui_cou">
    <div class="fanhui_1"></div>
    <div class="fanhui_ding">顶部</div>
</div> <header class="header header_1">
    <div class="fix_nav">
        <div style="max-width:768px;margin:0 auto;background:#db3652;position: relative;">
            <a class="nav-left back-icon" href="javascript:history.back();">返回</a>
            <div class="tit">订单已提交</div>
            <a class="nav-right icon-home" href="/dbs/index.html">首页</a>
        </div>
    </div>
</header>
<div class="common-wrapper receipt">
    <div class="m re-type bdb-1px" style="padding-top: 0px;">
        <div class="mt_new">
            <h2>${dbProduct.name}</h2>
        </div>
        <p class="list-group-item text-primary" style="border-top:none;border-left:none;border-right:none;border-bottom:1px solid #d7d7d7;">购买：<span class="red">${dbOrder.quantity}</span>
                <span class=" pull-right">

				                      合计：<span class="red">${dbTimes.singleAmount*dbOrder.quantity}夺宝币</span>
				      </span>
        </p>

        <div class="clr"></div>
    </div>
    <div class="receipt-tab-w">
        <input type="hidden" name="balanceAmount" />
        <input type="hidden" name="wechatAmount" />
        <div class="rtw">
            <div class="m re-con border-1px">
                <div id="balancePayment" class="list-group-item" style="font-size:14px;border-top:none;border-left:none;border-right:none;border-bottom:1px solid #d7d7d7;">
                    <span class="[#if member.virtualCurrency > 0]black[#else]gary[/#if] ">余额支付：(余额：${member.virtualCurrency} 夺宝币)</span>
                    <strong style="margin-top:2px;[#if member.virtualCurrency > 0]display:block;[#else]display:none;[/#if] " class="pic-ch pic-ched pull-right ml5" content="WeixinPayPlugin" id="invoince_content2"></strong>
                    <span class="pull-right"> <span style="[#if member.virtualCurrency > 0]display:block;[#else]display:none;[/#if]" class="ammount red pull-right">[#if member.virtualCurrency > 0][#if  member.virtualCurrency > dbTimes.singleAmount*dbOrder.quantity]${dbTimes.singleAmount*dbOrder.quantity}[#else]${member.virtualCurrency}[/#if]夺宝币[/#if]</span></span>
                </div>
                <div id="wechatPayment" style="font-size:14px;[#if dbTimes.singleAmount*dbOrder.quantity > member.virtualCurrency]display:block;[#else]display:none;[/#if]">
                    <div class="list-group-item" style="padding-right:50px;border-left:none;border-right:none;border-bottom:1px solid #d7d7d7;">
                        <span class="black">其他支付方式</span>
                        <span class="red pull-right ammount">[#if dbTimes.singleAmount*dbOrder.quantity > member.virtualCurrency]${dbTimes.singleAmount*dbOrder.quantity - member.virtualCurrency}元[/#if]</span>
                    </div>
                    <div class="mc">
                        <dl class="bdb-1px nobook">
                            <dd class="inv_noBookCheck" style="height:40px; overflow:hidden;vertical-align:middle;">
                                <strong style="margin-top:3px;"class="pic-ch  pic-ched" content="WeixinPayPlugin" id="invoince_content2"></strong>
                                <span >微信支付</span>
                            </dd>
                            <!--
                            <dd class="inv_noBookCheck">
                                <strong class="pic-ch " content="AliyunPayPlugin" id="invoince_content1"></strong>
                                <span>支付宝支付</span>
                            </dd>
                            -->

                        </dl>
                    </div>
                </div>

            </div>

        </div>
    </div>

    <div id="submitDiv" class="bottom-btn">
        <a href="javascript:void(0);" class="weui_btn weui_btn_warn" id="payBtn">立即支付</a>
    </div>
</div>

<div class="clear"></div>

<script type="text/javascript">
    var content;
    $(function(){
        // 余额
        var virtualCurrency = parseFloat("${member.virtualCurrency}");
        // 应付金额
        var amountPayable = parseFloat("${dbTimes.singleAmount*dbOrder.quantity}");

        $("#balancePayment strong").click(function(){
            $(this).toggleClass("pic-ched");
            // 余额支付
            if($(this).hasClass("pic-ched") ) {
                $("#balancePayment .ammount").show();
                if(amountPayable > virtualCurrency) {
                    $("#wechatPayment").show();
                    $("#wechatPayment .ammount").text(amountPayable - virtualCurrency + "元");
                }else {
                    $("#wechatPayment").hide();
                }
            }else {
                $("#balancePayment .ammount").hide();
                // 微信全额支付
                $("#wechatPayment").show();
                $("#wechatPayment .ammount").text(amountPayable + "元");
            }
        })

        // 支付
        $("#payBtn").click(function(){
            var amount=$(".m-pay-moneySelector-item-selected").attr("data-amount");
            content =  $("#content").val();

            if(amount==null){
                var re = /^[0-9]+.?[0-9]*$/;
                amount=$("input[name='amount']").val();
                if (!re.test(amount))
                {
                    alert("请输入数字");
                    $("input[name='amount']").val("");
                }
            }
            alert(content+"%%%%"+amount);
            paySubmit(amount);
        });

    });

</script>
</body></html>